home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-04 | 2.2 KB | 54 lines | [TEXT/R*ch] |
- Another old C source "brought back from the dead"
- by Kenneth A. Long, at itty bitty bytes™!
-
- I've posted this source before, included with other files, such as
- "OvalsDooDadd" which was derived from the about box of 'Display."
- But I must not have gotten the previous Display source to work just
- right, because I stated that it was "no big deal" or "nothing
- special."
-
- Well, in hitting it one more time, as though I'd never seen it
- before, I discovered that it's actually a cool application, for a
- couple of reasons.
-
- (1) It displays a 'TEXT' file in a "tty' method - not the usual way,
- with scroll bars, etc. Not as a real TextEdit thing. So, this
- source shows how that's done.
-
- (2) As Greg Corson says, it can let you scan a 'TEXT' file without
- firing up a full blown editor or word processor, if you "just want
- to see what's in it" or it's layout. Great for those "mysterious"
- text files you get off the net. It's like the UNIX "cat <filename>"
- thing, only Macintized! So it IS actually useful!
-
- One thing I noticed is that if you are looking at a file and you
- select About Display, from the Apple Menu, the display gets an
- override, the About... info and graphics are displayed, then when
- you click it all scrolls off the top. Doesn't "go" anywhere, but
- I thought that was interesting.
-
- The reason it does that is because ALL the stuff in the display is
- a bitmap. All the text is drawn by DrawChar calls, over and over.
- So, when it draws the About... stuf, it's just more bitmaps. The
- top few rows of which are erased as it scrolls up. Since you're
- reading a saved text file, it's only "drawing a picture" of the
- text, rather than a TE thing. So you couldn't "save" it, and there
- would be no need to.
-
- But, you could use the "tty" display to monitor a new file that was
- being created, like MacNosy does, or some ANSI programs, and "w" it
- to a file at the same time, as a text. Even use toolbox calls,
- instead of "w".
-
- The original built application I found crashed bigtime. In the
- TC debugger, it bus errored or simply froze-all, depending on what
- I had fixed so far. The final freeze was in "Open" and some pastes
- from MiniEdit cured it. I tried it, everything worked, and so, here
- you have it!
-
- -Enjoy-
-
- -Ken-
-
- kenlong@netcom.com
- kenlong@aol.com